home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Light ROM Gold
/
Light ROM Gold.iso
/
arexx
/
load3_5.lwm
< prev
next >
Wrap
Text File
|
1995-09-04
|
3KB
|
129 lines
/* CMD: Load Project
*
* This is a Lightwave Modeler Macro that will load a project that
* was saved with the "Save_Project.lwm" macro. It will load all objects
* up into seperate layers again.
*
* 2/94 Jason Mussetter
*
* 4/95 Modified By Daniel Bernard
*
* Added Code to Bring Up file requester
* for project selection instead of having
* to remember the project name
*
*/
mxx="LWModelerARexx.port"
signal on error
signal on syntax
mxx_add = addlib(mxx,0)
call main
if (mxx_add) then call remlib(mxx)
exit
syntax:
error:
t=Notify(1,'Rexx Script Error','@'ErrorText(rc), 'Line 'SIGL)
if (mxx_add) then call remlib(mxx)
exit
main:
/*
This section Modified By Daniel Bernard 4/95
Use a standard requestor to ask the user
for the Prefix of the Project's name.
*/
Prj_Prfx = GetFileName('Select Project File:')
if Prj_Prfx = "(none)" then exit
if Length(Prj_Prfx) < 1 then exit
p = pos(".",Prj_Prfx)
Prj_Prfx = Left(Prj_Prfx, (p - 2))
ProjectPrifix = Prj_Prfx
numlay:
CALL REQ_BEGIN("Load Project")
Num_Layr = REQ_ADDCONTROL("Number of Layers",number,0)
CALL REQ_POST()
If result = 0 then return
LayerCount = REQ_GETVAL(Num_Layr)
CALL REQ_END()
if LayerCount > "10" then call numlay
if LayerCount = "0" then call numlay
Cont = NOTIFY(3,"All project files are there?")
If result = 0 then return
if result = 1 then exit
/* After we have the Project's name prefix, we'll load each layer.
*
* NOTE: I added code to check for the existence of the object files
* this should make macro more stable and more forgiving
*/
CALL SETLAYER(1)
if EXISTS(ProjectPrifix||"1.lwob") then do
if LayerCount > 0 then CALL LOAD(ProjectPrifix||"1.lwob")
end
CALL SETLAYER(2)
if EXISTS(ProjectPrifix||"2.lwob") then do
if LayerCount > 1 then CALL LOAD(ProjectPrifix||"2.lwob")
end
CALL SETLAYER(3)
if EXISTS(ProjectPrifix||"3.lwob") then do
if LayerCount > 2 then CALL LOAD(ProjectPrifix||"3.lwob")
end
CALL SETLAYER(4)
if EXISTS(ProjectPrifix||"4.lwob") then do
if LayerCount > 3 then CALL LOAD(ProjectPrifix||"4.lwob")
end
CALL SETLAYER(5)
if EXISTS(ProjectPrifix||"5.lwob") then do
if LayerCount > 4 then CALL LOAD(ProjectPrifix||"5.lwob")
end
CALL SETLAYER(6)
if EXISTS(ProjectPrifix||"6.lwob") then do
if LayerCount > 5 then CALL LOAD(ProjectPrifix||"6.lwob")
end
CALL SETLAYER(7)
if EXISTS(ProjectPrifix||"7.lwob") then do
if LayerCount > 6 then CALL LOAD(ProjectPrifix||"7.lwob")
end
CALL SETLAYER(8)
if EXISTS(ProjectPrifix||"8.lwob") then do
if LayerCount > 7 then CALL LOAD(ProjectPrifix||"8.lwob")
end
CALL SETLAYER(9)
if EXISTS(ProjectPrifix||"9.lwob") then do
if LayerCount > 8 then CALL LOAD(ProjectPrifix||"9.lwob")
end
CALL SETLAYER(10)
if EXISTS(ProjectPrifix||"10.lwob") then do
if LayerCount > 9 then CALL LOAD(ProjectPrifix||"10.lwob")
end
return